package com.sakhalin.news.repositories

import com.sakhalin.news.network.NewsApi
import com.sakhalin.news.network.responses.NewsListResponse

class NewsListRepository(private val api: NewsApi = NewsApi.getInstance()) {
    suspend fun getNewsListByCategory(category: String, date: String = ""): NewsListResponse {
        return if (date.isNullOrBlank()) {
            api.getNewsListByCategory(category)
        }else{
            api.getNewsListByCategory(category,date)
        }
    }
}